Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Hit Information Masks

The Q3Pick_GetPickDetailValidMask function returns a mask for all types of TQ3PickDetail information that is relevant to a hit with the specified index for the given pick object. The Q3Pick_GetPickDetailValidMask call should be followed with a call to Q3Pick_GetPickDetailData for each corresponding type of pickDetail value set in the returned pickDetailValidMask . If a bit in pickDetailValidMask is 0, it means that either the pick detail type wasn't specified when the pick was created, or if it was specified then it was meaningless for the type of pick object or the geometry intersected.

The hit detail masks are values of type TQ3PickDetailMasks. See "Hit Detail Data" for a more complete description of the information these masks specify.

typedef enum TQ3PickDetailMasks {
    kQ3PickDetailNone                                           = 0,
    kQ3PickDetailMaskPickID                                     = 1 << 0,
    kQ3PickDetailMaskPath                                       = 1 << 1,
    kQ3PickDetailMaskObject                                     = 1 << 2,
    kQ3PickDetailMaskLocalToWorldMatrix                         = 1 << 3,
    kQ3PickDetailMaskXYZ                                        = 1 << 4,
    kQ3PickDetailMaskDistance                                   = 1 << 5,
    kQ3PickDetailMaskNormal                                     = 1 << 6,
    kQ3PickDetailMaskShapePart                                  = 1 << 7,
    kQ3PickDetailMaskPart                                       = 1 << 8,
    kQ3PickDetailMaskUV                                         = 1 << 9,
    } TQ3PickDetailMasks;

Constant descriptions

kQ3PickDetailNone
No pick detail. This mask results in faster picking, because various calculations do not need to be performed.
kQ3PickDetailMaskPickID
The picking ID of the picked object.
kQ3PickDetailMaskPath
The path through the model's group hierarchy to the picked object.
kQ3PickDetailMaskObject
A reference to the object handle of the picked object.
kQ3PickDetailMaskLocalToWorldMatrix
The matrix that transforms the local coordinate system of the picked object to the world coordinate system. Note that the local-to-world transform matrix for a multiply-referenced object differs for each reference to the object.
kQ3PickDetailMaskXYZ
The point of intersection between the picked object and the pick geometry in world space.
kQ3PickDetailMaskDistance
The distance between the intersected geometry and the origin of the pick geometry.
kQ3PickDetailMaskNormal
The surface normal of the picked object at the point of intersection with the pick geometry. The magnitude of this normal should always be returned as a normalized vector.
kQ3PickDetailMaskShapePart
The reference to the shape part object of the picked object.
kQ3PickDetailMaskPart
The object, edge, or vertex.
kQ3PickDetailMaskUV
The surface parameterization of the picked object.

© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |